/*************************************************
Author: tony
Date: 11/22/2012
Description:
Notes:
*************************************************/

#ifndef __cmddrug_h__
#define __cmddrug_h__

#include "../maindef.h"
#include "commclass.h"
#include "MsgDrug.pb.h"
#include "../mainctrl.h"

class CMainCtrl;
class CDrugConfigKey;
class CUserStorage;

class CCmdRoleDrugInfo : public CTAsyncCmd
{
public:
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqRoleDrugInfo stReq;
    MsgAnsRoleDrugInfo stAns;
};

class CCmdMakeDrug : public CTAsyncCmd
{
public:
	virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqDrugMake stReq;
    MsgAnsDrugMake stAns;
private:
    int PreCheck (CPlayerBaseInfo & stPlayerBaseInfo, CPlayerDetailInfo& stPlayerDetailInfo, CPlayerOnlineData & stPlayerOnlineData);
    int CalcRoleAttr(CPlayerBaseInfo & stPlayerBaseInfo, CPlayerDetailInfo& stPlayerDetailInfo, CPlayerOnlineData & stPlayerOnlineData, unsigned short usRoleId);
};

class CCmdInheritDrug : public CTAsyncCmd
{
public:
    enum OPT_TYPE
    {
        OPT_PREVIEW_INHERIT = 1,
        OPT_INHERIT_GOLD = 2,
        OPT_INHERIT_SILVER = 3,
    };

    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqDrugInherit stReq;
    MsgAnsDrugInherit stAns;
    unsigned int _uiGid;
    int _iNeedSilver;
    int _iNeedGold;
    int _bUsingGold;
private:
    int PreCheck (CPlayerBaseInfo & stPlayerBaseInfo, CPlayerDetailInfo& stPlayerDetailInfo, CPlayerOnlineData & stPlayerOnlineData);
};

#endif // __cmddrug_h__

